package cn.jsl.basic.util;


import lombok.Data;

/**
 * 封装增删改的Ajax异步操作结果
 * @author ITsource
 */
@Data
public class AjaxResult {
	
	private Boolean success = true;
	private String message = "操作成功";

	//用来封装额外的返回参数
	private Object resultObj;
	
	public AjaxResult() {}

	//链式语法改造
	public static AjaxResult me(){
		return new AjaxResult();
	}

	//链式语法改造
	public AjaxResult setResultObj(Object resultObj) {
		this.resultObj = resultObj;
		return this;
	}

	//链式语法改造
	public AjaxResult setSuccess(Boolean success) {
		this.success = success;
		return this;
	}

	//链式语法改造
	public AjaxResult setMessage(String message) {
		this.message = message;
		return this;
	}
	
	public AjaxResult(Boolean success, String message) {
		this.success = success;
		this.message = message;
	}
	public Boolean getSuccess() {
		return success;
	}

	public String getMessage() {
		return message;
	}

	public Object getResultObj() {
		return resultObj;
	}



}
